From 3a1c98ecfb44acb9c86adb56749e8d136ccd11bf Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 4 Jan 2007 15:58:20 +0000 Subject: [PATCH] [XEND] Allow arbitrary values for the vif 'type'. Signed-off-by: David Edmondson --- tools/python/xen/xend/server/netif.py | 8 ++++++-- tools/python/xen/xm/create.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/server/netif.py b/tools/python/xen/xend/server/netif.py index 92e5626ade..c229ed7b20 100644 --- a/tools/python/xen/xend/server/netif.py +++ b/tools/python/xen/xend/server/netif.py @@ -150,16 +150,20 @@ class NetifController(DevController): devid = self.allocateDeviceID() + # The default type is 'netfront'. + if not typ: + typ = 'netfront' + if not mac: mac = randomMAC() back = { 'script' : script, 'mac' : mac, - 'handle' : "%i" % devid } + 'handle' : "%i" % devid, + 'type' : typ } if typ == 'ioemu': front = {} - back['type'] = 'ioemu' else: front = { 'handle' : "%i" % devid, 'mac' : mac } diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index b603b922d6..140b6f7749 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -300,7 +300,7 @@ gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT,ba fn=append_value, default=[], use="""Add a network interface with the given MAC address and bridge. The vif is configured by calling the given configuration script. - If type is not specified, default is netfront not ioemu device. + If type is not specified, default is netfront. If mac is not specified a random MAC address is used. If not specified then the network backend chooses it's own MAC address. If bridge is not specified the first bridge found is used. -- 2.30.2